<%-- 
    Document   : updateComment
    Created on : 13-08-2014, 22:29:04
    Author     : NGOCLINH-PC
--%>

<%@page import="Data.Comment"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Data.RoleType"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

        <div class="tablemember">
            <form action="../CommentPR" method="post" name="formmember">    
                <h2 style="padding: 10px; color: #999;">Update Comment</h2>
                <hr />
                <table width="100%" border="0" align="center" cellpadding="14" cellspacing="14">
                    <%
                        if (request.getParameter("EcmtID") != null) {
                            Comment ct = new Comment();
                            int payID = Integer.parseInt(request.getParameter("EcmtID"));
                            ArrayList<Comment> a = ct.CmtselectByID(payID);
                            if (a.size() > 0) {
                                for (int i = 0; i < a.size(); i++) {
                                    Comment pay = a.get(i);
                    %>
                    <tr>
                        <td width='10%'>CommentID</td>
                        <td width='50%'><label for='txtcateid'></label>
                            <% out.print("<input type='text' readonly name='txtcateid' id='txtcateid' value='" + pay.getCommentID()+ "' /></td>");%>
                    </tr>

                    <tr>
                        <td width="10%">Content:</td>
                        <td width="57%"><label for="txtdanhmuc"></label>
                            <% out.print("<input type='text' readonly name='txtdanhmuc' id='txtdanhmuc' value='" + pay.getContents()+ "'/></td>");%>
                    </tr>

                    <tr>
                        <td>Status:</td>
                        <%
                            if (pay.getStatus() == 1) {
                                out.print("<td><input type='radio' name='radio1' id='rdtrangthai' value='1' checked />");
                                out.print(" Show ");
                                out.print("<input type='radio' name='radio1' id='rdtrangthai' value='0' />");
                                out.print("Hidden</td>");
                            } else {
                                out.print("<td><input type='radio' name='radio1' id='rdtrangthai' value='1' />");
                                out.print(" Show ");
                                out.print("<input type='radio' name='radio1' id='rdtrangthai' value='0' checked />");
                                out.print("Hidden</td>");
                            }

                        %>
                    </tr>
                    <tr align="">
                        <td></td>
                        <td ><input type="submit" name="btnsubmit" id="btnsubmit" value="Submit" />
                            </td>
                    </tr>
                    <%
                                }
                            }
                        } else {
                        }
                    %>  
                </table>

            </form>
        </div>
